% code for averaging SPM's
% just median of SPMatrix

% Latest date 22.4.3


function[SPM] = medSPM(SPMall),

A = size(SPMall);

for i = 1:A(1),
   for j = 1:A(3),
      for k = 1:A(4),
         SPM(i,j,k) = median(SPMall(i,:,j,k));
      end;
   end;
end;
 
     